package com.xjtu.project.controller.user;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xjtu.project.common.utls.JsonResponse;
import com.xjtu.project.model.domain.Category;
import com.xjtu.project.model.dto.CategoryDTO;
import com.xjtu.project.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/user")
public class CategoryUserController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/category/page")
    public JsonResponse categoryPage(CategoryDTO cat) {
        Page<Category> lists= categoryService.selectPagedMy(cat);
        return JsonResponse.success(lists);
    }

}
